home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lantools
/
blueprnt
/
prinserv.mod
< prev
next >
Wrap
Text File
|
1989-09-27
|
3KB
|
87 lines
;************************************************************
;* BP-LAN Print Server Module (PRINSERV.MOD) *
;* by Craig Chaiken *
;* September 21, 1989 *
;* *
;* Function : Print Characters to Specified Printer *
;************************************************************
;
;*** Variables ***
;
parown dw 3 dup ('UU',546,0,0) ;546=# of Clock Ticks in 30 seconds
prinser proc near ;*** Test for Print Block Commands ***
mov al,packet_buffer
cmp al,'P'
jnz prins1
jmp parallel
prins1: cmp al,'S'
jnz prins2
jmp serial
prins2: ret
prinser endp
parallel proc near ;*** Print Characters to Parallel Printer ***
;*** Obtain or Release Printer Ownership ***
push bx
push cx
push dx
push si
lea si,parown
mov bl,packet_buffer+2
xor bh,bh
mov cl,3
shl bx,cl
add si,bx
mov bl,socket_num
cmp [si+1],bl ;Is the printer owned by this client?
jz paral1
cmp byte ptr [si],'U' ;Is the printer unused?
jnz paral2
paral0: mov byte ptr [si],'L' ;Change ownership to this client
mov bl,socket_num
mov [si+1],bl
paral1: mov ah,packet_buffer+1 ;Print Character
mov dl,packet_buffer+2
mov al,packet_buffer+3
xor dh,dh
int 17h
call get_ticks
mov [si+4],cx
mov [si+6],dx
paral3: mov packet_buffer,ah ;Return Printer Status
put_packet socket_num,1,offset packet_buffer
pop si
pop dx
pop cx
pop bx
ret
paral2: call get_ticks
sub cx,[si+4]
sbb dx,[si+6]
cmp dx,0
jnz paral0
cmp cx,[si+2]
ja paral0
mov ah,0ffh ;Indicate that printer is locked
jmp paral3
parallel endp
serial proc near ;*** Print Characters to Serial Printer ***
;*** Obtain or Release Printer Ownership ***
mov ah,packet_buffer+1
mov dl,packet_buffer+2
mov al,packet_buffer+3
xor dh,dh
int 14h
mov packet_buffer,ah
mov packet_buffer+1,al
put_packet socket_num,2,offset packet_buffer
ret
serial endp
;************************************************************
;* End of Network Print Server Module *
;************************************************************